

#ifndef ARRAY_TRIM_H__
#define ARRAY_TRIM_H__

#include <stdint.h> 

#define BUFFER_SIZE     30

#define ARRAY_TRIM_STAGE_WAIT       0
#define ARRAY_TRIM_STAGE_BEGIN      1
#define ARRAY_TRIM_STAGE_FULL       2 

typedef struct{
    uint8_t stage;
    uint8_t len;
    uint8_t count_of_invalid;
    
    union{
        uint8_t*    u8;
        uint16_t*   u16;
        uint32_t*   u32;
    }param;
}array_trim_data_t; 

void array_trim_data_enqueue_byte(array_trim_data_t* trim, uint8_t data);

void array_trim_reset(array_trim_data_t* trim);

void array_data_trim_last_empty(array_trim_data_t* toTrim); 

#endif 

